using System.ComponentModel.DataAnnotations;

namespace RAG.Domain.Entities.App;

/// <summary>
/// 文档实体
/// </summary>
public class Document : EntityBase
{
    public Guid DocumentId { get; set; } //文档id
    public Guid UserId { get; set; } //用户id
    public Guid KnowledgeBaseId { get; set; } //知识库id
    
    [StringLength(200, ErrorMessage = "文档标题长度不能超过200个字符")]
    public string DocumentTitle { get; set; } = null!; //文档标题
    
    [StringLength(255, ErrorMessage = "文件名长度不能超过255个字符")]
    public string DocumentFileName { get; set; } = null!; //文件名
    
    [StringLength(500, ErrorMessage = "文件路径长度不能超过500个字符")]
    public string DocumentFilePath { get; set; } = null!; //文件路径
    
    [StringLength(50, ErrorMessage = "文件类型长度不能超过50个字符")]
    public string DocumentFileType { get; set; } = null!; //文件类型
    
    public long DocumentFileSize { get; set; } //文件大小(字节)
    
    [StringLength(50, ErrorMessage = "文档状态长度不能超过50个字符")]
    public string DocumentStatus { get; set; } = null!; //文档状态
    
    [StringLength(50, ErrorMessage = "访问级别长度不能超过50个字符")]
    public string DocumentAccessLevel { get; set; } = null!; //访问级别
    
    // 导航属性
    public Users User { get; set; } = null!;
    public KnowledgeBase KnowledgeBase { get; set; } = null!;
    public ICollection<DocumentChunk> DocumentChunks { get; set; } = new List<DocumentChunk>();
} 